Video encoding devices have been used for efficiently transmitting or recording videos. Examples of a specific video encoding method encompass H.264/MPEG-4 AVC (hereinafter abbreviated as H264/AVC) (described in Non Patent Literature 1) and a method employed in KTA software which is a joint development codec in VCEG (Video Coding Expert Group).
According to such an encoding method, an image (picture) constituting a video is managed in a hierarchical structure which is constituted by (i) a plurality of slices into which the image is divided, (ii) a plurality of macroblocks into which each of the plurality of slices is divided, (iii) a plurality of sub blocks into which each of the plurality of macroblocks is divided, and (iv) a plurality of blocks into which each of the plurality of macroblocks or the plurality of sub blocks is divided.
A video encoding device based on H264/AVC (1) subjects an image to DCT transform, (2) quantizes a frequency component obtained by the DCT transform (Discrete Cosine Transform), and (3) variable-length-codes the quantized frequency component, thereby obtaining an encoded image. Quantization step employed in quantization is variable with respect to each macroblock, and the video encoding device is designed to encode a quantization parameter that designates the size of the quantization step and to supply the encoded quantization parameter as well as the encoded image to a video decoding device.
The process for encoding the quantization parameter is detailed below with reference to (a) of FIG. 7, FIG. 11, and FIG. 12.
(a) of FIG. 7 is a view schematically showing a slice constituted by macroblocks MB1 to MBn. FIG. 12 is a view showing examples of difference values of quantization parameters assigned to the macroblocks MB1 to MBn. FIG. 11 is a table showing relations among difference values of quantization parameters, code numbers, and binary sequences outputted when binarizing the code numbers.
As shown in FIG. 12, the video encoding device determines, with respect to each picture, a default value pic_init_qp of a quantization parameter of the picture (hereinafter “picture default QP value”). Furthermore, the video encoding device determines, with respect to each slice included in the picture, a default value (SliceQPY) of a quantization parameter of the slice (hereinafter “slice default QP value”). Furthermore, the video encoding device determines, with respect to each slice, a difference value slice_qp_delta obtained by subtracting, from the slice default QP value of the slice, the picture default QP value of the picture including the slice.
Furthermore, the video encoding device determines, with respect to each macroblock MBi (i=1-n) included in each slice, a quantization parameter QPY in raster scan order, and determines, as a QP difference value of a macroblock MBi, a difference value mb_qp_delta (hereinafter “QP difference value”) obtained by subtracting, from the determined quantization parameter, a quantization parameter of a macroblock MBi−1 previous by one to the macroblock MBi in raster scan order. It should be noted that a QP difference value mb_qp_delta of a first macroblock MB1 in raster scan order is obtained by subtracting, from a quantization parameter determined with respect to the macroblock MB1, a slice default QP value SliceQPY of a slice including the macroblock MB1.
The video encoding device binarizes, based on the table shown in FIG. 11, the QP difference value mb_qp_delta generated as above. That is, the QP difference value is transformed, when the absolute value thereof is n, into a binary sequence whose length is 2n or 2n+1 by unary binarization.
Processes carried out by such a video encoding device and such a video decoding device have advantages below.
That is, 1) the amount of codes of an encoded image (main information) can be reduced efficiently without impairing subjective image quality of a decoded image decoded by a video decoding device, and 2) by regulating a quantization parameter suitably, the amount of codes of an encoded image with respect to each frame can be kept at a desired rate.
Furthermore, 3) by quantizing an image treated later as a reference image by a smaller quantization step, it is possible to reduce an amount of codes in prediction residual that is generated later, and thus to reduce an amount of codes in a video image as a whole, and 4) by regulating the amount of a quantization parameter so that RD (rate distortion) cost is small, an encoding efficiency can be increased.